package io.dataease.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.util.Date;

/**
 * 用户
 *
 * @author zcc
 * @email 860474958@qq.com
 * @date 2020-06-01
 */
@Data
@ApiModel(value = "SysUser", description = "用户实体对象")
public class SysUser {
    private static final long serialVersionUID = 1L;


    @ApiModelProperty(value = "主键", required = false)
    private String id;

    @ApiModelProperty(value = "邮箱(50)", required = true)
    @Length(max = 50, message = "邮箱 超出最大长度50")
    @Pattern(regexp = "^$|^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", message = "请输入正确格式的邮箱")
    @NotEmpty(message = "邮箱 不能为空")
    private String email;

    @ApiModelProperty(value = "手机", required = false)
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$", message = "请输入正确格式的手机号")
    @Length(max = 20, message = "手机 超出最大长度20")
    private String telephone;


    @ApiModelProperty(value = "用户状态", required = false)
    @Length(max = 1, message = "用户状态 超出最大长度1")
    private String status;

    @ApiModelProperty(value = "文件oss外网url", required = false)
    @Length(max = 50, message = "文件oss外网url超出最大长度50")
    private String url;

    @ApiModelProperty(value = "(0非admin1是)", required = false)
    @Length(max = 1, message = "admin 超出最大长度1")
    private String admin;

    @ApiModelProperty(value = "密码", required = false)
    @Length(max = 50, message = "密码 超出最大长度50")
    private String password;


    @ApiModelProperty(value = "加密盐", required = false)
    @Length(max = 50, message = "加密盐 超出最大长度50")
    private String salt;

    @ApiModelProperty(value = "姓名", required = false)
    @Length(max = 50, message = "姓名 超出最大长度50")
    @NotEmpty(message = "姓名 不能为空")
    private String userName;

    @ApiModelProperty(value = "登录名", required = true)
    @Length(max = 20, message = "登录名 超出最大长度20")
    @NotEmpty(message = "登录名 不能为空")
    private String loginName;

    @ApiModelProperty(value = "创建人", required = false)
    private String createBy;

    @ApiModelProperty(value = "更新人", required = false)
    private String updateBy;

    @ApiModelProperty(value = "创建时间", required = false)
    private Date createTime;

    @ApiModelProperty(value = "更新时间", required = false)
    private Date updateTime;

    private String jwtId;

    private String filterId;

    @ApiModelProperty(value = "附件的唯一编码", required = false)
    @Length(max = 500, message = "附件的唯一编码")
    private String signUuid;

    @ApiModelProperty(value = "部门id", required = false)
    @Length(max = 50, message = "部门id不能超过50")
    @NotEmpty(message = "部门不能为空")
    private String sysDepartId;

    @ApiModelProperty(value = "直属上级用户id", required = false)
    @Length(max = 50, message = "不能超出最大长度：50")
    private String sysLeaderId;

    @ApiModelProperty(value = "所属部门编号", required = false)
    private String sysDepartCode;

    @ApiModelProperty(value = "0.系统自带属性(只读)1.非系统自带属性", required = false, hidden = true)
    private String readonly;
}
